/* 消息相关样式 */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 欢迎消息 */
.welcome-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.welcome-message .message-content {
  max-width: 95%;
  width: 95%;
}

/* 消息基础样式 */
.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.message-content {
  max-width: 92%;
  padding: 16px 20px;
  border-radius: 18px;
  line-height: 1.5;
}

/* 头像样式 */
.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  box-shadow:
    0 4px 12px var(--primary-a20),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bot-avatar:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 20px var(--primary-a25),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.bot-avatar svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-strong) 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  box-shadow:
    0 4px 12px var(--primary-a20),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 20px var(--primary-a25),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.user-avatar .material-icons {
  font-size: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 用户消息样式 */
.user-message {
  background: var(--color-primary);
  color: white;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  max-width: 82%;
  line-height: 1.5;
  font-size: 14px;
  word-wrap: break-word;
  position: relative;
}

/* 机器人消息样式 */
.bot-message {
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 6px;
  max-width: 92%;
  width: 92%;
}

.message.assistant .message-content,
.bot-message {
  max-width: 92%;
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
}

.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 欢迎消息内容 */
.greeting-text {
  color: var(--color-text);
  margin-bottom: 16px;
  font-size: 14px;
}

.welcome-content {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  padding: 16px 20px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}

.bot-content {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  padding: 16px 20px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}

.bot-content pre {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--color-background);
  padding: 8px;
  border-radius: 4px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.session-info {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
  padding: 4px 8px;
  background: transparent;
  border-radius: 4px;
  font-family: monospace;
}

.info-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-section {
  line-height: 1.6;
  font-size: 13px;
}

.info-label {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.info-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.info-link:hover {
  text-decoration: underline;
}

.info-text {
  color: var(--color-text);
}